package my.generationCode; 


public class GenerationCode {
	
	
public long GenerationCodeBare( long inp){
	        
			long inpbu = inp;
			long temp = 0;
		
			int nb2 = 11; 
			long cd1;
			long resultat = 0;
			long modulo1 =0;
			long [] Tableau;
			Tableau = new long [12];
			for(int nb = 0; nb < 12; nb++) {
			    temp = inp % 10;
			    Tableau [nb2] = temp;
			   
			    inp = inp/10;
			    nb2 = nb2 -1;
			    }
			
			for (int i = 0; i < 12; i++) {
				
							
			if (i == 0 || i== 2 || i==4   || i==6 || i==8 || i==10)  {
					resultat = (resultat + Tableau[i]); }
							
				
			if (i == 1 || i== 3 || i==5   || i==7 || i==9 || i==11)  {
				resultat = (resultat + (Tableau[i] *3)); }
			
			
			}  
			modulo1 = resultat % 10;
			
			cd1 = 10 - modulo1;
			if (cd1 == 10) {cd1 = 0;}
			inpbu = (inpbu *10 + cd1);
			
	         return inpbu;
	        }

		}




